package com.ymatou.iapi.productmanager.testcase.old202012;

import com.ymatou.iapi.productmanager.parameter.product.AddSellerProductRequest;
import com.ymatou.iapi.productmanager.parameter.product.CatalogSaveModel;
import com.ymatou.iapi.productmanager.parameter.product.ProductFreightSaveModel;
import com.ymatou.iapi.productmanager.parameter.product.ProductVideoSaveModel;
import com.ymatou.iapi.productmanager.service.AddSellerProductCall;
import com.ymatou.iapi.productmanager.service.SaveCatalogPackageListCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.*;
import com.ymttest.common.order.userquery.util.HttpClientUtil;
import com.ymttest.database.annotation.SqlMapperFactory;
import com.ymttest.database.annotation.product.IntergratedProductMapper;
import com.ymttest.database.model.LiveRoom;
import com.ymttest.database.model.YmtProductsI;
import com.ymttest.database.sqlwapper.YmtProductsIWapper;
import com.ymttest.database.sqlwapper.Ymt_ExpressCountryToModeWapper;
import com.ymttest.database.sqlwapper.Ymt_ExpressSellerToModeWapper;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;
import org.json.JSONObject;
import org.junit.*;
import org.junit.experimental.categories.Category;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@Ignore
public class Ts_AddSellerProductV2 {

    private static String sellerName = EnvSetup.getData("productsellername");
    private static int sellerId = Integer.parseInt(EnvSetup.getData("productsellerid"));
    private static int sellerId1 = Integer.parseInt(EnvSetup.getData("globalSellerId"));
    private static AddSellerProductCall addSellerProductCall = new AddSellerProductCall();
    private static IntergratedProductMapper intergratedProductMapper = SqlMapperFactory.getIntergratedProductMapper();
    @BeforeClass
    public static void setUp() {
        Logger.createResultFile("发布商品");
//        intergratedProductMapper.updateProductoffSale(sellerId);
    }

    @Before
    public void caseUp() {
    }

    @AfterClass
    public static void tearDown() {
        Logger.generateResult(addSellerProductCall.getOpurl());
    }

    @After
    public void caseDown() {
        Logger.end();
    }

    /**
     * 0开头指参数校验
     * 1开头指商品领域
     * 2开头指规格领域
     * 3开头指物流领域
     * @throws Exception
     */

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1001() throws Exception {
        Logger.start(true,"商品-发布多规格商品"); 
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            ProductManagerCallServiceV3.AddSellerProduct(addProdReq);
            
            addProdReq.getProduct().getCatalogList().get(0).setPrice(0.01);
            addProdReq.getProduct().getCatalogList().get(0).setNewPrice(0.01);
            addProdReq.getProduct().getCatalogList().get(0).setVipPrice(0.01);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId, addProdReq);
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1002() throws Exception {
        Logger.start(true,"商品-发布单多规格商品");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().getCatalogList().remove(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId, addProdReq);
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    //code：200  有商品id
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1003() throws Exception {
        Logger.start(true,"商品-商品开始时间小于现在时间,发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setValidStart("2024-11-02 17:43:36");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_AddSellerProduct_1004() throws Exception {
        Logger.start(true,"商品-买手注册地发不允许销售的品牌,发布失败");
        try{
            JSONObject retBrand = new JSONObject(HttpClientUtil.requestPost("http://sellerAllocation.iapi.ymatou.com/Api/SellerAllocation/GetSellerCategory",
                    MapUtil.hashMap("SellerId",String.valueOf(sellerId))));
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.setSellerId(sellerId);
            addProdReq.setSellerName(sellerName);
            addProdReq.getProduct().setProductName("自动化测试_"+ YMTDateUtil.getSysTime("yyyy-MM-dd-HH-mm-ss-SSS"));
            addProdReq.getProduct().setRemark("remark_test");
            addProdReq.getProduct().setBrandId(retBrand.getJSONObject("Data").getJSONArray("BadBrandIDs").getInt(0));
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"很抱歉，您的注册地暂不支持销售该品牌。您可选择注册地的本土品牌进行售卖。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1005() throws Exception {
        Logger.start(true,"商品-主图重复,发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            List<String> list = new ArrayList<>();
            list.add("http://pc1.img.ymatou.com/G01/shangou/M00/2C/D0/rBBlD1gHOV6AY32AAAEN6UG5TOc701_400_401_n_w_l.jpg");
            list.add("http://pc1.img.ymatou.com/G01/shangou/M00/2C/D0/rBBlD1gHOV6AY32AAAEN6UG5TOc701_400_401_n_w_l.jpg");
            list.add("http://pc1.img.ymatou.com/G01/shangou/M00/2C/D0/rBBlD1gHOV6AY32AAAEN6UG5TOc701_400_401_n_w_l.jpg");
            addProdReq.getProduct().setProductPicList(list);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"主图中含有重复的商品图片");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1006() throws Exception {
        Logger.start(true,"商品-无效的商品图片,发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.getProduct().setProductPicList(new ArrayList<String>());
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"无效的商品图片");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1007() throws Exception {
        Logger.start(true,"商品-没有主图,发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.getProduct().setProductPicList(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"无效的商品图片");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1008() throws Exception {
        Logger.start(true,"商品-商品立即上架，开始时间和结束时间隔是7天");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数
            addProdReq.getProduct().setOnSaleType(0);
            addProdReq.getProduct().setValidEnd("2117-11-02 17:43:36");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            YmtProductsI ymtProductsI = new YmtProductsIWapper().selectProductByProductId(productId).get(0);
            AssertService.assertTime(YMTDateUtil.getDate(),ymtProductsI.getValidStart(),120,"验证商品的上架时间");
            AssertService.assertTime(YMTDateUtil.getBeforeOrNextDate(7),ymtProductsI.getValidEnd(),120,"验证商品的下架时间");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1009() throws Exception {
        Logger.start(true,"商品-商品定时上架，开始时间和结束时间隔是7天");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数
            addProdReq.getProduct().setOnSaleType(1);
            addProdReq.getProduct().setValidStart(YMTDateUtil.getBeforeOrNextDay(0));
            addProdReq.getProduct().setValidEnd("2117-11-02 17:43:36");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            YmtProductsI ymtProductsI = new YmtProductsIWapper().selectProductByProductId(productId).get(0);
            AssertService.assertTime(YMTDateUtil.getDate(),ymtProductsI.getValidStart(),120,"验证商品的上架时间");
            AssertService.assertTime(YMTDateUtil.getBeforeOrNextDate(7),ymtProductsI.getValidEnd(),120,"验证商品的下架时间");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1010() throws Exception {
        Logger.start(true,"商品-商品发布但不上架不能设置为自动延期");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.getProduct().setOnSaleType(2);
            addProdReq.getProduct().setAutoRefresh(true);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"发布但不上架不能设置为自动延期");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1011() throws Exception {
        Logger.start(true,"商品-FBX商品不支持预定");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.getProduct().setProductName("自动化测试_"+ YMTDateUtil.getSysTime("yyyy-MM-dd-HH-mm-ss-SSS"));
            addProdReq.getProduct().setRemark("remark_test");

            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().getCatalogList().get(0).setSku("123456");
            addProdReq.getProduct().getCatalogList().get(0).setPreSale(true);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"Fbx商品类型不支持可预订商品。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    /**
     * 大贸买手
     * @throws Exception
     */
    @Test
    @Category({P1.class})
    @TestCase
//    @Ignore
    public void Tc_AddSellerProduct_1013() throws Exception {
        Logger.start(true,"商品-大贸买手发布商品使用不被允许的二级类目");
        try{
            JSONObject retBrand = new JSONObject(HttpClientUtil.requestPost("http://sellerAllocation.iapi.ymatou.com/Api/SellerAllocation/GetSellerCategory",
                    MapUtil.hashMap("SellerId",String.valueOf(30243980))));
            Logger.debug(retBrand);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(30243980);
            //需修改的参数
            addProdReq.getProduct().setProductName("自动化测试_"+ YMTDateUtil.getSysTime("yyyy-MM-dd-HH-mm-ss-SSS"));
            addProdReq.getProduct().setRemark("remark_test");
            addProdReq.getProduct().setCatalogStatus(3);
            addProdReq.getProduct().setSecondCategoryId(63274);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"Fbx商品类型不支持可预订商品。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    /**
     * 大贸买手
     * @throws Exception
     */
    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_AddSellerProduct_1014() throws Exception {
        Logger.start(true,"商品-大贸买手发布商品使用不被允许的三级类目");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.getProduct().setProductName("自动化测试_"+ YMTDateUtil.getSysTime("yyyy-MM-dd-HH-mm-ss-SSS"));
            addProdReq.getProduct().setRemark("remark_test");
            addProdReq.getProduct().setThirdCategoryId(138946);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"Fbx商品类型不支持可预订商品。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1015() throws Exception {
        Logger.start(true,"商品-发布商品使用未启用的品牌（action<=-1）,发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.getProduct().setProductName("自动化测试_"+ YMTDateUtil.getSysTime("yyyy-MM-dd-HH-mm-ss-SSS"));
            addProdReq.getProduct().setRemark("remark_test");
            addProdReq.getProduct().setBrandId(10059);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您录入的品牌暂未收录，您可以先选择other/其他品牌发布商品，或在申报页面进行品牌申报");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ModifySellerProduct_3001() throws Exception {
        Logger.start(true,"编辑商品库商品，尺码模板没填，编辑失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            addProdReq.getProduct().setSpuId(238429);
            addProdReq.getProduct().setBrandId(10123);
            addProdReq.getProduct().setThirdCategoryId(1138);
            addProdReq.getProduct().getDescModel().setSizeTemplateId(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您已选择了商品库商品，尺码表模板必填");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1016() throws Exception {
        Logger.start(true,"商品-发布商品使用的品牌不是买手注册地所支持销售的品牌,发布失败");
        try{
            JSONObject retBrand = new JSONObject(HttpClientUtil.requestPost("http://sellerAllocation.iapi.ymatou.com/Api/SellerAllocation/GetSellerCategory",
                    MapUtil.hashMap("SellerId",String.valueOf(sellerId))));
            Logger.debug(retBrand);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV2.initAddSellerProductRequestV2(sellerId);
            //需修改的参数
            addProdReq.getProduct().setProductName("自动化测试_"+ YMTDateUtil.getSysTime("yyyy-MM-dd-HH-mm-ss-SSS"));
            addProdReq.getProduct().setRemark("remark_test");
            if (retBrand.getJSONObject("Data").getString("BadBrandIDs")!="null"){
                addProdReq.getProduct().setBrandId(retBrand.getJSONObject("Data").getJSONArray("BadBrandIDs").getInt(0));
                addSellerProductCall.setData(addProdReq);
                addSellerProductCall.callService();
                JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
                Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"很抱歉，您的注册地暂不支持销售该品牌。您可选择注册地的本土品牌进行售卖");
            }
        }catch(Exception e){
            Logger.fail(e);
        }
    }



    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2001() throws Exception {
        Logger.start(true,"规格-普通商品编码可以为空");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setSku(null);
            addProdReq.getProduct().getCatalogList().get(1).setSku(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"发布但不上架不能设置为自动延期");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2002() throws Exception {
        Logger.start(true,"规格-规格价格小于等于0，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setPrice(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"规格价格不能为 0");
            //价格为负数
            addProdReq.getProduct().getCatalogList().get(0).setPrice(-1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"规格价格不能为 0");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2003() throws Exception {
        Logger.start(true,"规格-添加多规格商品,一个规格未启用，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setAction(-2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"规格价格不能为 0");
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2004() throws Exception {
        Logger.start(true,"规格-发布库存为0的商品，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setStock(0);
            addProdReq.getProduct().getCatalogList().get(1).setStock(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"规格价格不能为 0");
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2005() throws Exception {
        Logger.start(true,"规格-FBX商品商品编码为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            //需修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().getCatalogList().get(0).setSku(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"Fbx商品规格商品编码不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2006() throws Exception {
        Logger.start(true,"规格-vip和新客价高于原价，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数 vip价高与原价
            addProdReq.getProduct().getCatalogList().get(0).setPrice(10);
            addProdReq.getProduct().getCatalogList().get(0).setVipPrice(20);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
            //新客价高于原价
            addProdReq.getProduct().getCatalogList().get(0).setVipPrice(8);
            addProdReq.getProduct().getCatalogList().get(0).setNewPrice(20);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2007() throws Exception {
        Logger.start(true,"规格-，原价，vip价格和新客价小于0，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数 原价小于0
            addProdReq.getProduct().getCatalogList().get(0).setPrice(-10);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
            //vip价小于0
            addProdReq.getProduct().getCatalogList().get(0).setPrice(10);
            addProdReq.getProduct().getCatalogList().get(0).setVipPrice(-20);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
            //新客价小于0
            addProdReq.getProduct().getCatalogList().get(0).setVipPrice(9);
            addProdReq.getProduct().getCatalogList().get(0).setNewPrice(-20);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2008() throws Exception {
        Logger.start(true,"规格-，vip价格和新客价高于原价，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需修改的参数 vip价高与原价
            addProdReq.getProduct().getCatalogList().get(0).setPrice(10);
            addProdReq.getProduct().getCatalogList().get(0).setVipPrice(20);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
            //新客价高于原价
            addProdReq.getProduct().getCatalogList().get(0).setNewPrice(20);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"新客价或VIP价不能小于 0 或高于原价。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2009() throws Exception {
        Logger.start(true,"规格-FBX单规格商品编码不是贝海有效期编码，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            addProdReq.getProduct().getCatalogList().remove(0);
            //需要修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().getCatalogList().get(0).setSku("029149");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效，请先确认FBX仓库是否选择正确");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2010() throws Exception {
        Logger.start(true,"规格-FBX多规格商品编码不是贝海有效期编码，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            //需要修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().getCatalogList().get(0).setSku("029149");
            addProdReq.getProduct().getCatalogList().get(1).setSku("383627");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效，请先确认FBX仓库是否选择正确");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2011() throws Exception {
        Logger.start(true,"规格-Fbx商品套装规格的商品编码为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            //需要修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().getCatalogList().get(0).setPackage(true);
            addProdReq.getProduct().getCatalogList().get(0).setSku("ceshi100");
            addProdReq.getProduct().getCatalogList().get(0).setSubCatalogIdList(Arrays.asList(3911));

            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"Fbx商品套装规格的商品编码不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2012() throws Exception {
        Logger.start(true,"规格-添加多规格商品带套装商品，发布成功");
        try{
            SaveCatalogPackageListCall saveCatalogPackageListCall = new SaveCatalogPackageListCall();
            int packageId1 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合001测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);

            int packageId2 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合002测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setPackage(true);
            addProdReq.getProduct().getCatalogList().get(0).setSubCatalogIdList(Arrays.asList(packageId1,packageId2));

            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            //检查商品
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2013() throws Exception {
        Logger.start(true,"规格-套装规格商品套装为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setPackage(true);
            addProdReq.getProduct().getCatalogList().get(0).setSubCatalogIdList(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"请设置规格的套装信息");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Deprecated
    public void Tc_AddSellerProduct_2014() throws Exception {
        Logger.start(true,"规格-套装规格FBX商品套装不能超过3个子套装，发布失败");
        try{
            SaveCatalogPackageListCall saveCatalogPackageListCall = new SaveCatalogPackageListCall();
            int packageId1 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合001测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);

            int packageId2 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合002测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);
            int packageId3 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合002测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);
            int packageId4 = saveCatalogPackageListCall.callAndGetReturnData(MapUtil.hashMap("ProductPackageList[0]->SubCatalogName","测试组合002测试组合001"))
                    .getJSONObject("Data").getJSONArray("SubCatalogIdList").getInt(0);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            addProdReq.getProduct().getCatalogList().remove(0);
            //需要修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().setCatalogStatus(3);
            addProdReq.getProduct().getCatalogList().get(0).setSku("ceshi100");
            addProdReq.getProduct().getCatalogList().get(0).setPackage(true);
            addProdReq.getProduct().getCatalogList().get(0).setProductCode("ceshinb");
            addProdReq.getProduct().getCatalogList().get(0).setSubCatalogIdList(Arrays.asList(packageId1,packageId2,packageId3,packageId4));
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"请设置规格的套装信息");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2015() throws Exception {
        Logger.start(true,"规格-发布预定自动延期商品，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setPreSale(true);
            addProdReq.getProduct().getCatalogList().get(1).setPreSale(true);
            addProdReq.getProduct().setAutoRefresh(true);
//            addProdReq.getProduct().setPackageDeliveryType(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"请设置规格的套装信息");
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2016() throws Exception {
        Logger.start(true,"规格-发布商品，商品条码为空，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setProductCode(null);
            addProdReq.getProduct().getCatalogList().get(1).setProductCode(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2017() throws Exception {
        Logger.start(true,"规格-发布FBX商品，商品条码为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().getCatalogList().get(0).setProductCode(null);
            addProdReq.getProduct().getCatalogList().get(1).setProductCode(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2018() throws Exception {
        Logger.start(true,"规格-发布多规格商品带视频，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            ProductVideoSaveModel productVideo = new ProductVideoSaveModel();
            productVideo.setVideoUrl("http://v2.ymatou.com/uploads/20180103/6a44924f0b4968e88321061a3704b4cf.mp4");
            productVideo.setPic("http://pic1.ymatou.com/G01/shangou/M00/3B/22/rBBlD1pMiOCAWitxAADUmGEFNI0402_1_1_n_w_o.jpg");
            productVideo.setLength(11573);
            productVideo.setWidth(400);
            productVideo.setHeight(30);
            productVideo.setSize(3070568);
            addProdReq.getProduct().setVideoModel(productVideo);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Deprecated
    public void Tc_AddSellerProduct_2019() throws Exception {
        Logger.start(true,"规格-发布商品限制规格类型超过两种，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数

            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Deprecated
    public void Tc_AddSellerProduct_2020() throws Exception {
        Logger.start(true,"规格-FBX贝海库存小于0，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数

            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2021() throws Exception {
        Logger.start(true,"规格-发布多规格预定商品，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setPreSale(true);
            addProdReq.getProduct().getCatalogList().get(1).setPreSale(true);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
            JSONObject ret = new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2022() throws Exception {
        Logger.start(true,"规格-添加多规格商品带运费模板，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            ProductFreightSaveModel freightModel = new ProductFreightSaveModel();
            freightModel.setCatalogStatus(3);
            freightModel.setTemplateId(4123);
            addProdReq.getProduct().setFreightTemplateList(Arrays.asList(freightModel));
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"发布失败，您填写的商品编码无效");
            JSONObject ret = new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2023() throws Exception {
        Logger.start(true,"规格-添加多规格商品带模板带大贸，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getDescModel().setDeclarationId(123);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            JSONObject ret = new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2024() throws Exception {
        Logger.start(true,"规格-添加多规格商品带SPU，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setSpuId(002);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            JSONObject ret = new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2025() throws Exception {
        Logger.start(true,"规格-发布多规格多属性商品，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setSpuId(002);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            JSONObject ret = new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_2026() throws Exception {
        Logger.start(true,"规格-已启用规格库存小于0，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            //未启用规格
            addProdReq.getProduct().getCatalogList().get(0).setStock(-1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"已启用的规格库存不能小于");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0001() throws Exception {
        Logger.start(true,"参数检验-发布商品品牌不存在，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setBrandId(100000);
            addProdReq.getProduct().setBrandName("随意");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您录入的品牌暂未收录，您可以先选择other/其他品牌发布商品，或在申报页面进行品牌申报。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }



    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0002() throws Exception {
        Logger.start(true,"参数检验-发布优选商品类目跟商品库不匹配，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setSpuId(825443564);
            addProdReq.getProduct().setSecondCategoryId(378263);
            addProdReq.getProduct().setThirdCategoryId(93274);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您已选择了商品库商品，商品品类和品牌需与优选商品模板保持一致不能修改。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    //Code:500  系统异常
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0003() throws Exception {
        Logger.start(true,"参数检验-买手不存在，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(387908);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("500",addSellerProductCall.getString("Code"),"未知错误，系统异常");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0005() throws Exception {
        Logger.start(true,"参数检验-品牌id为0，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setBrandId(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"该商品当前使用的是自定义品牌，现在发布编辑商品需使用系统申报审核通过的品牌信息，可去买手PC后台申报或者选择“Other/其他品牌”继续保存。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0006() throws Exception {
        Logger.start(true,"参数检验-商品名称为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setProductName(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品名称必填");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0008() throws Exception {
        Logger.start(true,"参数检验-商品名称敏感词校验");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setProductName("全网唯一");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息，请修改！");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0009() throws Exception {
        Logger.start(true,"参数检验-商品规格属性敏感词校验");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().getCatalogList().get(0).getPropertyList().get(0).setPropertyValue("全网唯一");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息，请修改！");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0010() throws Exception {
        Logger.start(true,"参数检验-商品文描文字敏感词校验");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().getDescModel().setDescription("全网唯一");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息，请修改！");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0011() throws Exception {
        Logger.start(true,"参数检验-商品属性属性值列表敏感词校验");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String str = "全网唯一";
            addProdReq.getProduct().getPropertyList().get(0).getPropertyValues().add(str);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您输入的：“全网唯一”为不宜发布的信息，请修改！");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0012() throws Exception {
        Logger.start(true,"参数检验-商品二级类目为空，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setSecondCategoryId(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"根据三级类目自动补全二级类目");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0013() throws Exception {
        Logger.start(true,"参数检验-商品三级类目为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setThirdCategoryId(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"请选择商品类目");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0014() throws Exception {
        Logger.start(true,"参数检验-不选择配送方式，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setCatalogStatus(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"请选择配送方式");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0016() throws Exception {
        Logger.start(true,"参数检验-商品文描为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setDescModel(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品文描不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0017() throws Exception {
        Logger.start(true,"参数检验-商品文描文字描述为空，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().getDescModel().setDescription(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品文描不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Deprecated
    public void Tc_AddSellerProduct_0018() throws Exception {
        Logger.start(true,"参数检验-商品文描图中含有重复的图片，发布成功，已兼容");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            String str = "http://s2.ymatou.com/home/4aa0780b5ffeee46a01f132052fdb71a.png";
            addProdReq.getProduct().getDescModel().setDescPicList(Arrays.asList(str,str,str));
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品文描不能为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0019() throws Exception {
        Logger.start(true,"参数检验-商品备注长度不能超过700个英文字符，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setRemark("你好啊");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            String remark = "123";
            for(Integer i=0;i<701;i++){
                remark = remark + i.toString();
            }
            addProdReq.getProduct().setRemark(remark);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品备注长度不能超过700个英文字符");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0020() throws Exception {
        Logger.start(true,"参数检验-商品数据无，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.setProduct(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("400",addSellerProductCall.getString("Code"),"商品数据为空");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0021() throws Exception {
        Logger.start(true,"参数检验-商品规格缺失，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setCatalogList(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品或规格数据缺失");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0022() throws Exception {
        Logger.start(true,"参数检验-商品名称含斜杠\\，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setProductName("buhai a \\");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品规格含有不宜发布的特殊字符“\\”");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0023() throws Exception {
        Logger.start(true,"参数检验-规格属性值含斜杠\\，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().getCatalogList().get(0).getPropertyList().get(0).setPropertyValue("\\n你好啊");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品或规格数据缺失");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0024() throws Exception {
        Logger.start(true,"参数检验-商家商品编码超过50个汉字或英文字符，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            String str = "你好啊";
            for (int i=0;i<51;i++){
                str = str + i;
            }
            addProdReq.getProduct().getCatalogList().get(0).setSku(str);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商家商品编码不得超过50个汉字或英文字符，请修改。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0025() throws Exception {
        Logger.start(true,"参数检验-商品条码不得超过30个汉字或英文字符，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            String str = "你好啊";
            for (int i=0;i<30;i++){
                str = str + i;
            }
            addProdReq.getProduct().getCatalogList().get(0).setProductCode(str);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品条码不得超过30个汉字或英文字符，请修改。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0026() throws Exception {
        Logger.start(true,"参数检验-不填商品属性，发布成功，不校验");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setPropertyList(null);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"商品条码不得超过30个汉字或英文字符，请修改。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_AddSellerProduct_0027() throws Exception {
        Logger.start(true,"参数检验-进口贸易买手所在国家发布不支持的类目商品，发布失败");
        try{
            JSONObject retBrand = new JSONObject(HttpClientUtil.requestPost("http://sellerAllocation.iapi.ymatou.com/Api/SellerAllocation/GetSellerCategory",
                    MapUtil.hashMap("SellerId",String.valueOf(24607503))));
            Logger.debug(retBrand);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品条码不得超过30个汉字或英文字符，请修改。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0028() throws Exception {
        Logger.start(true,"参数检验-买手所在国家仅支持选择进口贸易物流方式，发布失败");
        try{
            JSONObject retBrand = new JSONObject(HttpClientUtil.requestPost("http://orderdelivery.iapi.ymatou.com/api/Express/GetAvailableDeliveryMethod",
                    MapUtil.hashMap("SellerId",String.valueOf(479419))));
            Logger.debug(retBrand);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(20223383);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品条码不得超过30个汉字或英文字符，请修改。");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_AddSellerProduct_0029() throws Exception {
        Logger.start(true,"参数检验-添加FBX贝海国内仓商品进入扫货现场，发布失败");
        try{
            List<Integer> liveIds = LiveCallService.createLivesInProcessAndInFuture(sellerId, sellerName, 2, 3);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            addProdReq.getProduct().getCatalogList().remove(0);

            //需修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().setCatalogStatus(3);
            addProdReq.getProduct().getCatalogList().get(0).setSku("ceshi100");
            addProdReq.getProduct().setLiveIdList(liveIds);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            Logger.verifyEquals(201, ret.getInt("Code"), "返回code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3001() throws Exception {
        Logger.start(true,"参数检验-第三方保税配送方式与保税区不匹配，发布失败");
        try{
            JSONObject retBrand = new JSONObject(HttpClientUtil.requestPost("http://orderdelivery.iapi.ymatou.com/api/Express/GetAvailableDeliveryMethod",
                    MapUtil.hashMap("SellerId",String.valueOf(sellerId))));
            //retBrand.getJSONObject("Data").getJSONArray("BadBrandIDs").getInt(0)
            Logger.debug(retBrand);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(4);
            addProdReq.getProduct().setBondedArea(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"买手没有当前的保税仓发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }



    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3003() throws Exception {
        Logger.start(true,"物流-商品的物流方式不支持该价格，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV2.initAddSellerProductRequest(288484);
            addProdReq.getProduct().getCatalogList().remove(0);
            List<CatalogSaveModel> catalogSaveModelList = addProdReq.getProduct().getCatalogList();
            AddSellerProductRequest addProdReq2 = AddProductCallService.getAddSellerProductRequestFromFile("单规格",
                    MapUtil.hashMap("sellerId",288484,"sellerName",sellerName));
            CatalogSaveModel catalogMode3 = addProdReq2.getProduct().getCatalogList().get(0);
            catalogMode3.setPrice(12000);
            catalogMode3.setVipPrice(1000);
            catalogMode3.setNewPrice(900);
            catalogMode3.setOperateType(1);
            catalogSaveModelList.add(catalogMode3);
            addProdReq.getProduct().setCatalogStatus(7);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"商品的物流方式不支持该价格");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3004() throws Exception {
        Logger.start(true,"物流-买手选择多物流，多物流差价值未填，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setMultiLogistics(3);
            addProdReq.getProduct().setMultiLogistics(2);
            addProdReq.getProduct().setFlightBalance(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"请填写多物流的差价");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3005() throws Exception {
        Logger.start(true,"物流-保税商品，没有填保税区，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(4);
            addProdReq.getProduct().setBondedArea(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"保税商品，必须填写保税区");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3012() throws Exception {
        Logger.start(true,"物流-第三方保税，买手没有当前保税仓权限，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(4);
            addProdReq.getProduct().setBondedArea(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"买手没有当前的保税仓发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3006() throws Exception {
        Logger.start(true,"物流-买手没有当前物流发布权限，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(9);//5贝海保税区，4买手保税区
            addProdReq.getProduct().setBondedArea(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"买手没有当前的物流方式发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3007() throws Exception {
        Logger.start(true,"物流-买手没有当前的物流方式发布权限-买手国家没有物流权限，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(5);//5贝海保税区，4买手保税区
            addProdReq.getProduct().setBondedArea(2);
            Ymt_ExpressCountryToModeWapper countryToModeWapper=new Ymt_ExpressCountryToModeWapper();
            Ymt_ExpressSellerToModeWapper sellerToMode=new Ymt_ExpressSellerToModeWapper();
            //先删isDelete=true
            countryToModeWapper.updateBycountryAndStatus(0, addProdReq.getProduct().getCatalogStatus(), true);
            sellerToMode.updateBySellerIdAndStatus(sellerId, addProdReq.getProduct().getCatalogStatus(), true);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"买手没有当前的物流方式发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3008() throws Exception {
        Logger.start(true,"物流-买手没有当前国家的保税仓发布权限-贝海保税区，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(5);//5贝海保税区，4买手保税区
            addProdReq.getProduct().setBondedArea(2);
            Ymt_ExpressCountryToModeWapper countryToModeWapper=new Ymt_ExpressCountryToModeWapper();
            Ymt_ExpressSellerToModeWapper sellerToMode=new Ymt_ExpressSellerToModeWapper();
            //先删isDelete=true
            countryToModeWapper.updateBycountryAndStatus(0, addProdReq.getProduct().getCatalogStatus(), true);
            sellerToMode.updateBySellerIdAndStatus(sellerId, addProdReq.getProduct().getCatalogStatus(), true);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"买手没有当前的物流方式发布权限");
            //后设置isDelete=false
            countryToModeWapper.updateBycountryAndStatus(0, addProdReq.getProduct().getCatalogStatus(), false);
            sellerToMode.updateBySellerIdAndStatus(sellerId, addProdReq.getProduct().getCatalogStatus(), false);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3009() throws Exception {
        Logger.start(true,"物流-买手没有当前的保税仓发布权限-买手保税区，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //需要修改的参数
            addProdReq.getProduct().getCatalogList().get(0).setPreSale(true);

            Ymt_ExpressSellerToModeWapper sellerToMode=new Ymt_ExpressSellerToModeWapper();

            addProdReq.getProduct().setCatalogStatus(4);//5贝海保税区，4买手保税区
            addProdReq.getProduct().setBondedArea(2);
            sellerToMode.updateBySellerIdAndStatus(sellerId, addProdReq.getProduct().getCatalogStatus(), true);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"买手没有当前的物流方式发布权限");
            sellerToMode.updateBySellerIdAndStatus(sellerId, addProdReq.getProduct().getCatalogStatus(), false);
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_AddSellerProduct_3013() throws Exception {
        Logger.start(true,"物流-大贸买手发预定商品，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(24636606);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(1);
            addProdReq.getProduct().getCatalogList().get(0).setPreSale(true);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("400",addSellerProductCall.getString("Code"),"您当前所在国家不支持发布预订商品");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    @Deprecated
    public void Tc_AddSellerProduct_3016() throws Exception {
        Logger.start(true,"物流-大贸买手发FBX商品，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(24636606);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(1);
            addProdReq.getProduct().setCatalogType(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"您当前所在国家不支持发布预订商品");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    @Ignore
    public void Tc_AddSellerProduct_3014() throws Exception {
        Logger.start(true,"物流-发布FBX商品");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(3383);
            addProdReq.getProduct().getCatalogList().remove(0);
            //需要修改的参数
            addProdReq.getProduct().setCatalogType(2);
            addProdReq.getProduct().setCatalogStatus(3);
            //需要去贝海那边找有效的sku编码
            addProdReq.getProduct().getCatalogList().get(0).setSku("ceshi100");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            String productId = addSellerProductCall.getJsonObject().get("Data").getAsJsonObject().get("ProductId").getAsString();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3015() throws Exception {
        Logger.start(true,"物流-买手所在国家不支持多物流，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(20239694);
            //需要修改的参数
            addProdReq.getProduct().setCatalogStatus(2);
            addProdReq.getProduct().getCatalogList().get(0).setMultiLogistics(3);
            addProdReq.getProduct().setMultiLogistics(2);
            addProdReq.getProduct().setFlightBalance(10);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"买手没有当前的物流方式发布权限");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3017() throws Exception {
        Logger.start(true,"物流-发布101商品，发布成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"买手没有当前的物流方式发布权限");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    /**
     * 市场价格仅限101买手
     * @throws Exception
     */
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3018() throws Exception {
        Logger.start(true,"物流-101买手，市场价格小于含税价，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            addProdReq.getProduct().getCatalogList().get(0).setMarketPrice(5);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"市场价需大于等于含税价");
        }catch(Exception e){
            Logger.fail(e);
        }
    }


    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3020() throws Exception {
        Logger.start(true,"物流-市场价格小于0，发布失败");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            addProdReq.getProduct().getCatalogList().get(0).setMarketPrice(-1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"市场价不能小于 0");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3021() throws Exception {
        Logger.start(true,"发布商品，拼邮发货，海外发货,发布成功");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            addProdReq.getProduct().setPackageDeliveryType(1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证code");
            String productId = addSellerProductCall.getJsonObject().get("Data").getAsJsonObject().get("ProductId").getAsString();

            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3022() throws Exception {
        Logger.start(true,"发布商品，拼邮发货，国内发货,发布成功");
        try{
            int id = 20223383;
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(id);
            addProdReq.getProduct().setCatalogStatus(7);
            addProdReq.getProduct().getCatalogList().get(0).setPreSale(true);
            addProdReq.getProduct().getCatalogList().get(1).setPreSale(true);
            addProdReq.getProduct().setPackageDeliveryType(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证code");
            String productId = addSellerProductCall.getJsonObject().get("Data").getAsJsonObject().get("ProductId").getAsString();

            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3023() throws Exception {
        Logger.start(true,"发布商品，买手无国内发货权限,发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setCatalogStatus(7);
            addProdReq.getProduct().setPackageDeliveryType(2);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"验证code");

        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3024() throws Exception {
        Logger.start(true,"发布商品，无效的拼邮类型,发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            addProdReq.getProduct().setPackageDeliveryType(3);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"验证code");

        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3025() throws Exception {
        Logger.start(true,"直播间快速发布商品,无效的直播间编号");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setLiveRoomId(1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("400",addSellerProductCall.getString("Code"),"验证code");

        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3026() throws Exception {
        Logger.start(true,"直播间快速发布商品,发布成功");
        try{
            LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(sellerId));
            LiveRoomCallService.UpdateLiveTimeToStart(createlive.getId());
            LiveRoomCallService.SellerLiveOnline(createlive.getId(), createlive.getUserId());

            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setLiveRoomId(createlive.getId());
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            String productId = addSellerProductCall.getJsonObject().get("Data").getAsJsonObject().get("ProductId").getAsString();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证code");
            AddProductCallServiceV2.checkAddProduct(productId, addProdReq);
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_302７() throws Exception {
        Logger.start(true,"直播间快速发布商品,上架发布的商品达到上限");
        try{
            LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(sellerId));
            for (int i=0;i<81;i++){
                AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
                addProdReq.getProduct().setLiveRoomId(createlive.getId());
                addSellerProductCall.setData(addProdReq);
                addSellerProductCall.callService();
            }
            Logger.verifyEquals("400",addSellerProductCall.getString("Code"),"验证code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3028() throws Exception {
        Logger.start(true,"直播间快速发布商品,直播间为关闭状态，发布失败");
        try{
            LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(sellerId));
            LiveRoomCallService.CloseSellerLive(createlive.getId(),sellerId,8);
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setLiveRoomId(createlive.getId());
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("400",addSellerProductCall.getString("Code"),"验证code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_3029() throws Exception {
        Logger.start(true,"直播间快速发布商品,直播间不存在，发布失败");
        try{
            AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setLiveRoomId(1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("400",addSellerProductCall.getString("Code"),"验证code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_0015() throws Exception {
        Logger.start(true,"参数检验-保税商品，不填写保税区，发布不成功");
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setCatalogStatus(4);
            addProdReq.getProduct().setBondedArea(0);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    
    @Test
	@Category({P1.class})
	@TestCase
	public void Tc_AddSellerProduct_0031() {
		Logger.start(true," 发布商品澳新版拼邮溯源， 低于100元  拼邮国内发货---不可以");
		try {
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(20323792);
			addProdReq.getProduct().setSecondCategoryId(1130);
			addProdReq.getProduct().setThirdCategoryId(1117);
			addProdReq.getProduct().setPackageDeliveryType(2);
			addProdReq.getProduct().setCatalogStatus(7);
			addSellerProductCall.setData(addProdReq);
	        addSellerProductCall.callService();
	        Logger.verifyEquals("201",addSellerProductCall.getString("Code"),"验证code");

		}catch(Exception e){
			Logger.fail(e);
		}
	}
    
    
    @Test
	@Category({P1.class})
	@TestCase
	public void Tc_AddSellerProduct_0030() {
		Logger.start(true," 发布商品澳新版拼邮溯源，低于100元---贝海保税  可以");
		try {
			AddSellerProductRequest addProdReq = ProductManagerCallServiceV3.initAddSellerProductRequest(20323792);
			addProdReq.getProduct().setSecondCategoryId(1130);
			addProdReq.getProduct().setThirdCategoryId(1117);
			addProdReq.getProduct().setCatalogStatus(5);
			addSellerProductCall.setData(addProdReq);
	        addSellerProductCall.callService();
	        Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证code");
		}catch(Exception e){
			Logger.fail(e);
		}
	}
    
    
    @Test
	@Category({P1.class})
	@TestCase
	public void Tc_AddSellerProduct_0032() {
		Logger.start(true," 发布商品增加推荐理由字段，成功");
		try {
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId1);
            addProdReq.getProduct().setRecomReason("墙裂推荐");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"买手没有当前的物流方式发布权限");
            AddProductCallServiceV2.checkAddProduct(productId,addProdReq);
		}catch(Exception e){
			Logger.fail(e);
		}
	}
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1033() throws Exception {
        Logger.start(true,"商品-发布多规格商品-设置tag"); 
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            List<String> tag=new ArrayList<String>();
            for (int i = 0; i < 5; i++) {
            	tag.add("Test"+i);
			}
            addProdReq.getProduct().setProductTags(tag);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId, addProdReq);
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            List<Map> list = intergratedProductMapper.selectYmtProductTag(productId);
            List<String> tags = (List<String>) list.stream().map(x->{return  x.get("Tag").toString();}).collect(Collectors.toList());
            tag.forEach(x->{
            	Logger.verifyEquals(true, tags.contains(x), "tag");
            }); 
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1034() throws Exception {
        Logger.start(true,"商品-发布多规格商品-设置recomReason"); 
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            addProdReq.getProduct().setRecomReason("recomReason");
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId, addProdReq);
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1035() throws Exception {
        Logger.start(true,"商品-发布多规格商品-设置tag-更新LastUseTime"); 
        try{
			Integer cid=1001;
			Integer thirdcategoryid=1003;
			String tag="测试"+TestDataManager.getRandomIntNum(4);
			ProductManagerCallServiceV3.DeleteAllSellerPorductTags(sellerId, thirdcategoryid);
			//添加标签
			int id=ProductManagerCallServiceV3.AddSellerPorductTags(sellerId, cid, thirdcategoryid, tag);
			List<Map> list = intergratedProductMapper.selectYmtSellerProductTag(sellerId, thirdcategoryid);
			Map m = list.stream().filter(x->{return x.get("Tag").toString().equals(tag);}).findAny().get();
			Logger.debug(m);
			// UpdateTime=2020-09-16 15:59:21.027, SellerId=288484, Id=413, Tag=测试5610, LastUseTime=2020-09-16 15:59:21.027
			Thread.sleep(1100);
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            List<String> tags=new ArrayList<String>();
            tags.add(tag);
            addProdReq.getProduct().setProductTags(tags);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId, addProdReq);
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
            list = intergratedProductMapper.selectYmtSellerProductTag(sellerId, thirdcategoryid);
			Map m2 = list.stream().filter(x->{return x.get("Tag").toString().equals(tag);}).findAny().get();
			Logger.debug(m2);
			Logger.verifyNotEquals(m.get("UpdateTime").toString(), m2.get("UpdateTime").toString(), "更新UpdateTime");
			Logger.verifyNotEquals(m.get("LastUseTime").toString(), m2.get("LastUseTime").toString(), "更新LastUseTime");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_AddSellerProduct_1036() throws Exception {
        Logger.start(true,"商品-发布多规格商品-publishType1图片商品"); 
        try{
            AddSellerProductRequest addProdReq =ProductManagerCallServiceV3.initAddSellerProductRequest(sellerId);
            //普通商品主图中含有重复的商品图片会失败，PublishType1图文商品允许重发
            addProdReq.getProduct().setPublishType(1);
            String t1=addProdReq.getProduct().getProductPicList().get(0);
            addProdReq.getProduct().getProductPicList().add(t1);
            addSellerProductCall.setData(addProdReq);
            addSellerProductCall.callService();
            JSONObject ret=new JSONObject(addSellerProductCall.getReturnData());
            String productId = ret.getJSONObject("Data").getString("ProductId");
            AddProductCallServiceV2.checkAddProduct(productId, addProdReq);
            Logger.verifyEquals("200",addSellerProductCall.getString("Code"),"验证Code");
        }catch(Exception e){
            Logger.fail(e);
        }
    }
}
